/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
using System;
using System.Collections.Generic;

using Aliyun.Acs.Core.Transform;
using Aliyun.Acs.R_kvstore.Model.V20150101;

namespace Aliyun.Acs.R_kvstore.Transform.V20150101
{
    public class DescribeReplicaConflictInfoResponseUnmarshaller
    {
        public static DescribeReplicaConflictInfoResponse Unmarshall(UnmarshallerContext context)
        {
			DescribeReplicaConflictInfoResponse describeReplicaConflictInfoResponse = new DescribeReplicaConflictInfoResponse();

			describeReplicaConflictInfoResponse.HttpResponse = context.HttpResponse;
			describeReplicaConflictInfoResponse.RequestId = context.StringValue("DescribeReplicaConflictInfo.RequestId");
			describeReplicaConflictInfoResponse.ReplicaId = context.StringValue("DescribeReplicaConflictInfo.ReplicaId");
			describeReplicaConflictInfoResponse.PagNumber = context.IntegerValue("DescribeReplicaConflictInfo.PagNumber");
			describeReplicaConflictInfoResponse.PageRecordCount = context.IntegerValue("DescribeReplicaConflictInfo.PageRecordCount");
			describeReplicaConflictInfoResponse.TotalRecordCount = context.IntegerValue("DescribeReplicaConflictInfo.TotalRecordCount");

			List<DescribeReplicaConflictInfoResponse.DescribeReplicaConflictInfo_ItemsItem> describeReplicaConflictInfoResponse_items = new List<DescribeReplicaConflictInfoResponse.DescribeReplicaConflictInfo_ItemsItem>();
			for (int i = 0; i < context.Length("DescribeReplicaConflictInfo.Items.Length"); i++) {
				DescribeReplicaConflictInfoResponse.DescribeReplicaConflictInfo_ItemsItem itemsItem = new DescribeReplicaConflictInfoResponse.DescribeReplicaConflictInfo_ItemsItem();
				itemsItem.SourceInstanceId = context.StringValue("DescribeReplicaConflictInfo.Items["+ i +"].SourceInstanceId");
				itemsItem.DestinationInstanceId = context.StringValue("DescribeReplicaConflictInfo.Items["+ i +"].DestinationInstanceId");
				itemsItem.OccurTime = context.StringValue("DescribeReplicaConflictInfo.Items["+ i +"].OccurTime");
				itemsItem.DetailInfo = context.StringValue("DescribeReplicaConflictInfo.Items["+ i +"].DetailInfo");
				itemsItem.ConfictKey = context.StringValue("DescribeReplicaConflictInfo.Items["+ i +"].ConfictKey");
				itemsItem.ConfictReason = context.StringValue("DescribeReplicaConflictInfo.Items["+ i +"].ConfictReason");
				itemsItem.DatabaseName = context.StringValue("DescribeReplicaConflictInfo.Items["+ i +"].DatabaseName");
				itemsItem.RecoveryMode = context.StringValue("DescribeReplicaConflictInfo.Items["+ i +"].RecoveryMode");
				itemsItem.ConflictGtid = context.StringValue("DescribeReplicaConflictInfo.Items["+ i +"].ConflictGtid");

				describeReplicaConflictInfoResponse_items.Add(itemsItem);
			}
			describeReplicaConflictInfoResponse.Items = describeReplicaConflictInfoResponse_items;
        
			return describeReplicaConflictInfoResponse;
        }
    }
}
